import request from "@/utils/request";
import type { HospitalResponseData,HospitalLevalAndRegionResponseData,HospitalInfo } from "./type";
enum API{
    // 获取已有医院的数据接口地址
    HOSPITAL_URL='/hosp/hospital/',
    // 获取医院的等级和地区接口
    HOSPITALLEVELANDREGION_URL='/cmn/dict/findByDictCode/',
    // 根据关键字医院名字获取接口
    HOSPITALINFO_URL='/hosp/hospital/findByHosname/'
}

export const reqHospital=(page:number,limit:number,hostype='',districCode='')=>request.get<any,HospitalResponseData>(API.HOSPITAL_URL+`${page}/${limit}?hostype=${hostype}&districtCode=${districCode}`)
export const reqHospitalAndRegion=(dictCode:string)=>request.get<any,HospitalLevalAndRegionResponseData>(API.HOSPITALLEVELANDREGION_URL+`${dictCode}`)
export const reqHospitalInfo=(hosname:string)=>request.get<any,HospitalInfo>(API.HOSPITALINFO_URL+hosname)